Skip to content

Update the extension examples repo to use the latest extension template #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 78 commits into from
Aug 13, 2025

Conversation

cmarmo
Copy link
Contributor

@cmarmo cmarmo commented Jun 28, 2025

Dear maintainers,

this pull request updates the extension examples to the latest extension template.

I tried to create one commit per example as I feel it could make the review easier, don't hesitate to squash the commits if this PR is merged.

Hopefully this update will solve the failing CI in #279

Thank you for your attention.

@cmarmo
Copy link
Contributor Author

cmarmo commented Aug 5, 2025

Thank you @krassowski!
Yes I have updated the package.json files, as I could't succeed in update from copier.... I understand now that the tag was missing.

@cmarmo
Copy link
Contributor Author

cmarmo commented Aug 5, 2025

Don´t bother starting the CI ... I have some new failures in my test version too... 🤔

@cmarmo
Copy link
Contributor Author

cmarmo commented Aug 5, 2025

I have fixed codemirror toparea-text-widget and shout-button

@krassowski
Copy link
Member

It looks like the codemirror test is flaky. In the recording it looks fine:

image

and it passed on Mac but failed (timed out waiting on await page.notebook.setCell) on Ubuntu.

I think it is an issue with galata's implementation of page.notebook.setCell - for code cells it waits for stable rendering:

https://github.com/jupyterlab/jupyterlab/blob/b4b496e9a0704da70266ade98bcd74929f15ee26/galata/src/helpers/notebook.ts#L1266-L1294

Maybe using a markdown cell in this test could help?

@cmarmo
Copy link
Contributor Author

cmarmo commented Aug 11, 2025

I think it is an issue with galata's implementation of page.notebook.setCell - for code cells it waits for stable rendering:

I guess this is the issue for toolbar-button too then (https://github.com/jupyterlab/extension-examples/actions/runs/16755565700/job/47482296812?pr=284#step:19:158).
In that case I cannot modify the cell type to 'markdown' as there is no output for markdown cells.
Should I modify galata?

@krassowski
Copy link
Member

toolbar-button looks different, it seems like a bug with the toolbar overflowing and overlapping the cell:

image

As a workaround maybe we should collapse the left sidebar? There is a method for it in galata/

@krassowski
Copy link
Member

Looking at kernel-output failure:

Error:   1) tests/kernel-output.spec.ts:3:5 › should open a panel connected to a notebook kernel ──────────
    Error: locator.selectOption: Test timeout of 120000ms exceeded.
    Call log:
      - waiting for locator('.jp-Dialog-body').locator('select')
        - locator resolved to <select class="jp-mod-styled">…</select>
      - attempting select option action
        2 × waiting for element to be visible and enabled
          - did not find some options
        - retrying select option action
        - waiting 20ms
        2 × waiting for element to be visible and enabled
          - did not find some options
        - retrying select option action
          - waiting 100ms
        219 × waiting for element to be visible and enabled
            - did not find some options
          - retrying select option action
            - waiting 500ms
image

// Select Notebook kernel
await page.locator('.jp-Dialog-body').locator('select').selectOption({
label: 'Untitled.ipynb'
});

I suspect the label no longer matches. Looking at this dialog it usually looks like:

image

I think we would need something like:

const select = page.locator('.jp-Dialog-body').locator('select');
const optionLocator = select.locator('option', { hasText: /Untitled.ipynb.*/ });
const value = await optionLocator.getAttribute('value');
await page.locator('.jp-Dialog-body').locator('select').selectOption({ value }); 

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @cmarmo!

@krassowski krassowski merged commit 639bd2a into jupyterlab:main Aug 13, 2025
185 of 186 checks passed
@cmarmo
Copy link
Contributor Author

cmarmo commented Aug 13, 2025

Well thank you @krassowski for your patience and your help!

@cmarmo cmarmo deleted the update-template branch August 13, 2025 16:51
@jtpio
Copy link
Member

jtpio commented Aug 13, 2025

Thank you @cmarmo and @krassowski, super cool to see the repo updated and the CI back to green!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants